﻿#pragma once

#include <string>
#include <queue>
#include <mutex>
// D5XMessageBox 对话框

class D5XMessageBox : public CDialogEx
{
	DECLARE_DYNAMIC(D5XMessageBox)

public:
	D5XMessageBox(CWnd* pParent = nullptr);   // 标准构造函数
	virtual ~D5XMessageBox();

	void SetContent(CString content);
	void SetTitle(CString title);

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_DIALOG_MESSAGEBOX };
#endif

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()
private:
	afx_msg void OnClose();
	afx_msg void OnBnClickedButton1();
	CStatic m_pContent;
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	void ShowMessage(std::string title, std::string content);
	void ConfirmOrCloseShowMessage();
	virtual void OnCancel();
	virtual void OnOK();

public:
	int AddNewMessage(std::string title, std::string content);

private:
	std::queue<std::pair<std::string, std::string>> _msgQueue;
	std::mutex _pushMsgSync;
	CStatic m_pIcon;

};
